<?php 
/**
 * config.php
 * - Setting all required configurations like: db connection, smarty variables, etc.
 * @since 1.0 - Aug 04, 2011
 * $Id: $
 */
//ini_set('display_errors', 2);
// DOCUMENT_ROOT is the absolute path to project folder in server.
define("DOCUMENT_ROOT", realpath(dirname(__FILE__).'/..'));
// Define path folder lib
define("LIB_DIR", DOCUMENT_ROOT . "/lib");
// Define path folder core
define("LIB_CORE_DIR", LIB_DIR . "/core");
// Define path folder dao
define("LIB_DAO_DIR", LIB_DIR . "/dao");
// Define path folder third-party
define("LIB_THIRD_PARTY_DIR", LIB_DIR . "/library");
// Define path folder conf
define("CONF_DIR", DOCUMENT_ROOT . "/conf");
// Define path folder ui
define("LIB_UI_DIR", LIB_DIR . "/ui");
// Define path folder htdocs
//define("HTDOC_DIR", DOCUMENT_ROOT . "/htdocs");
// Define path folder css
define("HTDOC_CSS_DIR", DOCUMENT_ROOT . "/css");
// Define path folder flash
define("HTDOC_FLASH_DIR", DOCUMENT_ROOT . "/flash");
// Define path folder images
define("HTDOC_IMAGES_DIR", DOCUMENT_ROOT . "/images");
// Define path folder js
define("HTDOC_JS_DIR", DOCUMENT_ROOT . "/js");
// Define path folder module
define("MODULE_DIR", DOCUMENT_ROOT . "/module");
// Define path folder actions
define("MODULE_ACTION_DIR", MODULE_DIR . "/actions");
// Define path folder templates
define("MODULE_TEMPLATES_DIR", MODULE_DIR . "/templates");
// Define URL folder image use view image
define("FOLDER_IMAGE_DIR", "images");
// Defile path logs
define("LOGS_DIR", DOCUMENT_ROOT . "/logs");
// Define path web
define("WEB_LINK", "http://" . $_SERVER['HTTP_HOST'] . "/svn");
//define("WEB_LINK", "http://" . $_SERVER['HTTP_HOST']);
// Include constants file
include_once(CONF_DIR . "/constants.php");

if ($_SERVER['HTTP_HOST'] != 'localhost') {
	constants::$dbList = array(
		"dbtype" => "mysql",
		"host" =>  "localhost",
		"username" => "muathenhanh_com",
		"password" => "yNGhMbltk8g",
		"database" => "muathenhanh_com",
		"dbcon" => true,
		"debug" => false,
		"table_list" => 'sanpham m_user giohang donhang khohang m_news dichvu sp_category sp_sub_category danhmuc',
	);
} else {
	constants::$dbList = array(
		"dbtype" => "mysql",
		"host" =>  "localhost",
		"username" => "root",
		"password" => "",
		"database" => "muathenhanh",
		"dbcon" => true,
		"debug" => false,
		"table_list" => 'sanpham m_user giohang donhang khohang m_news dichvu sp_category sp_sub_category danhmuc',
	);
}

// Define the DB connection using ADOdb
include_once(LIB_THIRD_PARTY_DIR . "/ADOdb/adodb.inc.php");
// Init for all database
constants::$dbList['dbcon'] = ADONewConnection(constants::$dbList["dbtype"]);	
?>
